package ProjectTeam39.GUITest;

import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextPane;
import java.awt.SystemColor;
import javax.swing.JButton;

import ProjectTeam39.Domains.UserList;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class invoiceFrame extends JFrame {
	UserList ul;
	invoiceFrame iframe = this;
	
	public invoiceFrame(final UserList ul) {
		this.ul = ul;
		JPanel panel = new JPanel();
		getContentPane().add(panel, BorderLayout.NORTH);
		
		JLabel lblTreatedByOn = new JLabel("<Patient Name> Treated By <Doctor Name> On <Date>");
		lblTreatedByOn.setFont(new Font("Tahoma", Font.PLAIN, 14));
		panel.add(lblTreatedByOn);
		
		JPanel panel_1 = new JPanel();
		getContentPane().add(panel_1, BorderLayout.CENTER);
		panel_1.setLayout(null);
		
		JTextPane txtpnIExist = new JTextPane();
		txtpnIExist.setText("Invoice string gets inserted here");
		txtpnIExist.setBackground(SystemColor.control);
		txtpnIExist.setEditable(false);
		txtpnIExist.setBounds(22, 11, 288, 217);
		panel_1.add(txtpnIExist);
		
		JPanel panel_2 = new JPanel();
		getContentPane().add(panel_2, BorderLayout.SOUTH);
		
		JButton btnBack = new JButton("Back");
		btnBack.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				PatientFrame pframe = new PatientFrame(ul);
				iframe.setVisible(false);
				pframe.setBounds(100, 100, 450, 300);
				pframe.setVisible(true);
				pframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			}
		});
		panel_2.add(btnBack);
	}
}
